<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>欢迎使用南通装饰管理系统</title>
    <link href="/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/style.css" media="all">
	<link rel="stylesheet" type="text/css" href="/Public/Admin/css/<?php echo (C("COLOR_STYLE")); ?>.css" media="all">
     <!--[if lt IE 9]>
    <script type="text/javascript" src="/Public/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/jquery.mousewheel.js"></script>
    <!--<![endif]-->
    
</head>
<body>
    <!-- 头部 -->
    <div class="header">
        <!-- Logo -->
        <span class="logo"></span>
        <!-- /Logo -->

        <!-- 主导航 -->
        <ul class="main-nav">
            <?php if(is_array($__MENU__["main"])): $k = 0; $__LIST__ = $__MENU__["main"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($k % 2 );++$k;?><li class="<?php echo ((isset($menu["class"]) && ($menu["class"] !== ""))?($menu["class"]):''); ?>">
                <?php if((getgroupid($mid) == 2) AND ($k == 2)): ?><a href="/Admin/persun/index.html"><?php echo ($menu["title"]); ?></a></li>
	            <?php elseif((getgroupid($mid) == 5) AND ($k == 2)): ?>
	                <a href="/Admin/questions/index.html"><?php echo ($menu["title"]); ?></a></li>
                <?php else: ?>
	                <a href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a></li><?php endif; endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <!-- /主导航 -->

        <!-- 用户栏 -->
        <div class="user-bar">
            <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
            <ul class="nav-list user-menu hidden">
                <li class="manager">你好，<em title="<?php echo session('user_auth.username');?>"><?php echo session('user_auth.username');?></em></li>
                <li><a href="<?php echo U('User/updatePassword');?>">修改密码</a></li>
                <li><a href="<?php echo U('User/updateNickname');?>">修改昵称</a></li>
                <li><a href="<?php echo U('Public/logout');?>">退出</a></li>
            </ul>
        </div>
    </div>
    <!-- /头部 -->

    <!-- 边栏 -->
    <div class="sidebar">
        <!-- 子导航 -->
        
            <div id="subnav" class="subnav">
                <?php if(!empty($_extra_menu)): ?>
                    <?php echo extra_menu($_extra_menu,$__MENU__); endif; ?>
                <?php if(is_array($__MENU__["child"])): $i = 0; $__LIST__ = $__MENU__["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub_menu): $mod = ($i % 2 );++$i;?><!-- 子导航 -->
                    <?php if(!empty($sub_menu)): if(!empty($key)): ?><h3><i class="icon icon-unfold"></i><?php echo ($key); ?></h3><?php endif; ?>
                        <ul class="side-sub-menu">
                            <?php if(is_array($sub_menu)): $i = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li>
                                    <a class="item" href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a>
                                </li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul><?php endif; ?>
                    <!-- /子导航 --><?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        
        <!-- /子导航 -->
    </div>
    <!-- /边栏 -->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
            <?php if(!empty($_show_nav)): ?><div class="breadcrumb">
                <span>您的位置:</span>
                <?php $i = '1'; ?>
                <?php if(is_array($_nav)): foreach($_nav as $k=>$v): if($i == count($_nav)): ?><span><?php echo ($v); ?></span>
                    <?php else: ?>
                    <span><a href="<?php echo ($k); ?>"><?php echo ($v); ?></a>&gt;</span><?php endif; ?>
                    <?php $i = $i+1; endforeach; endif; ?>
            </div><?php endif; ?>
            <!-- nav -->
            

            
	<script type="text/javascript" src="/Public/static/uploadify/jquery.uploadify.min.js"></script>

    <style>
        .comment_img img{width:200px; height: 150px; margin-right:10px;}
        .comment_title>span{margin-right:30px; font-size: 15px;}
        .tou_xiang{border-radius: 50%; width:50px; height: 50px; float: left; }

        .pinglun_list .userfz{ margin-right: 20px;}
        .pinglun_list{ min-height: 50px;  padding-top:10px;padding-bottom: 10px;margin-left:30px; border-bottom: 1px dashed #D4CFCF; }
        .btn_save,.btn_delete{color: red;margin-left:10px; cursor: pointer; margin-left:5px;}
        .btn_save:hover,.btn_delete:hover{text-decoration: underline;}
        .del_file{position: absolute;top: -7px;right: 5px;width: 17px;height: 17px;background: url(/Public/Admin/images/bg_icon.png) no-repeat -25px 0;cursor: pointer;}
    </style>

    <div class="main-title">
        <h2>评论内容</h2>
    </div>
    <ul class="tab-nav nav">
        <li class="current"><a href="javascript:void(0)">基本信息</a></li>
    </ul>
    
    <form action="<?php echo U();?>" method="post" class="form-horizontal">
        <input type="hidden" name="id" value="<?php echo ($vo["id"]); ?>" />
    <div class="tab-content">
        <div class="form-item">
            <label class="item-label comment_title"><span>发布人：<?php echo ($vo['username']); ?></span><span>身份：<?php echo ($vo['user_type']); ?></span><span>项目名称：<?php echo ($vo['title']); ?></span></label>
            <div class="controls">
                <label class="textarea" style="width:800px;">
                <textarea name="content" class="save_cont" data-id="<?php echo ($vo['id']); ?>"><?php echo ($vo['content']); ?></textarea>
                </label>
            </div>
        </div>
        <div class="form-item">
            <div class="controls">
                <div class="comment_img" style="width: 105%">
                    <?php if(is_array($vo['imgarr'])): $i = 0; $__LIST__ = $vo['imgarr'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$img): $mod = ($i % 2 );++$i;?><div class="comm_img" style="float: left; position: relative;">
                            <img src="<?php echo picture($img);?>" />
                            <span class="del_file" title="删除" data-id="<?php echo ($vo['id']); ?>" data-imgid="<?php echo ($img); ?>"></span>
                        </div><?php endforeach; endif; else: echo "" ;endif; ?>
                </div>
			</div>
        </div>

        <div class="form-item">
            <div class="controls" style="border-top:1px solid #D4CFCF; ">

                    <?php if(is_array($son_list)): $i = 0; $__LIST__ = $son_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$son): $mod = ($i % 2 );++$i;?><div class="pinglun_list">
                            <img class="tou_xiang" src="<?php echo ($son['icon']); ?>" />
                            <div class="parent" style="width: 80%; float: left; margin-left:18px;margin-top: 14px;">
                                <span class="userfz"><?php echo ($son['user_type']); ?></span>
                                <span class="cont2 cont_1"><?php echo ($son['content']); ?><font class="btn_save">修改</font><font class="btn_delete" data-id="<?php echo ($son['id']); ?>">删除</font></span>
                                <span class="cont2 cont_2" style="display: none;"><input type="text" class="save_cont" value="<?php echo ($son['content']); ?>" style="width:80%; height: 30px;" data-id="<?php echo ($son['id']); ?>" /></span>
                            </div>
                        </div><?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        </div>

        <div class="form-item" style="margin-top: 40px;">
           <!-- <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>-->
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </div>

    </form>


        </div>
        <div class="cont-ft">
            <div class="copyright">
                <div class="fl">感谢使用<a href="/" target="_blank">南通装饰</a>管理平台</div>
                <!--<div class="fr">V<?php echo (ONETHINK_VERSION); ?></div>-->
            </div>
        </div>
    </div>
    <!-- /内容区 -->
    <script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/index.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    </script>
    <script type="text/javascript" src="/Public/static/think.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();

            /* 左边菜单高亮 */
            url = window.location.pathname + window.location.search;
            url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
            $subnav.find("a[href='" + url + "']").parent().addClass("current");

            /* 左边菜单显示收起 */
            $("#subnav").on("click", "h3", function(){
                var $this = $(this);
                $this.find(".icon").toggleClass("icon-fold");
                $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
                      prev("h3").find("i").addClass("icon-fold").end().end().hide();
            });

            $("#subnav h3 a").click(function(e){e.stopPropagation()});

            /* 头部管理员菜单 */
            $(".user-bar").mouseenter(function(){
                var userMenu = $(this).children(".user-menu ");
                userMenu.removeClass("hidden");
                clearTimeout(userMenu.data("timeout"));
            }).mouseleave(function(){
                var userMenu = $(this).children(".user-menu");
                userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
                userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
            });

	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });

            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
    </script>
    
<link href="/Public/static/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<?php if(C('COLOR_STYLE')=='blue_color') echo '<link href="/Public/static/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">'; ?>
<link href="/Public/static/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/Public/static/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/Public/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript" src="/Public/static/layer/layer.js"></script>
    <script type="text/javascript">
	
		$('.tab-nav li').click(function(){
			$(this).attr('class','current')
						.siblings().attr('class','');
			var n_index=$('.tab-nav li').index(this);
				$('.tab-content').eq(n_index).show()
							 .siblings().hide();
		});
	
        //导航高亮
        highlight_subnav('<?php echo U('Comment/index');?>');

        $(".btn_save").click(function () {
            $(this).parent('.cont_1').hide();
            $(this).parents('.parent').find('.cont_2').show();
        });
        $(".save_cont").blur(function () {
            var ids = $(this).attr('data-id');
            var value =  $(this).val();
            var obj = $(this);
            $.post('/Admin/Ajax/save_message',{id:ids,value:value,model:'comment'},function (dd) {
                   if(dd.code==200){
                       layer.msg(dd.msg,{time:1000});
                       setTimeout(function () {
                          // obj.parent('.cont_2').hide();
                          // obj.parents('.parent').find('.cont_1').show();
                           window.location.reload();
                       },1000)
                   }else{
                       layer.msg(dd.msg);
                   }
            })
        });

        $(".btn_delete").click(function () {
            var id = $(this).attr('data-id');
            var obj = $(this);
            layer.confirm('确定要删除吗？', {
                btn: ['确定','取消'] //按钮
            }, function(){
                $.post('/Admin/Ajax/deleinfo',{id:id,model:'comment'},function (dd) {
                    if(dd.code==200){
                        layer.msg(dd.msg,{time:1000});
                        setTimeout(function () {
                            obj.parents('.pinglun_list').remove();
                        },1000)
                    }else{
                        layer.msg(dd.msg);
                    }
                })
            });
        });

        //删除图片
        $(".del_file").click(function () {
            var id   = $(this).attr('data-id');
            var imgid = $(this).attr('data-imgid');
            var thiser = $(this);
            $.post('/Admin/Ajax/del_msgimg',{id:id,imgid:imgid},function (dd) {
                if(dd.code==200){
                    thiser.parent('.comm_img').remove();
                }else{
                    layer.msg(dd.msg);
                }
            });
        });


    </script>

</body>
</html>